package org.flexspeedup.blog.events
{

import flash.events.Event;
import org.flexspeedup.blog.models.MiniPost;

/**
 * Selects a post in the model
 */
public class SelectPostEvent extends Event
{
    //--------------------------------------------------------------------------
    //
    //  Class Properties
    //
    //--------------------------------------------------------------------------

    //--------------------------
    // ID
    //--------------------------
    /**
     * Unique id for this event.
     */
    public static const ID:String = "SelectPostEvent";
    
    //--------------------------------------------------------------------------
    //
    // Constructor
    //
    //--------------------------------------------------------------------------

    /**
     * Creates a new instance of the <code>SelectPostEvent</code> event 
     */    
    public function SelectPostEvent(post:MiniPost)
    {
        super(ID, true, true);
        _post = post;
    }

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------
    
    //----------------------------------
    //  post
    //----------------------------------

    /**
     *  @private
     */
    private var _post:MiniPost;

    /**
     * The minipost to select in the model
     */
    public function get post():MiniPost
    {
        return _post;
    }    

    //--------------------------------------------------------------------------
    //
    //  Overridden Methods - Event
    //
    //--------------------------------------------------------------------------

    /**
     * @inheritdoc flash.events.Event#clone
     */
    override public function clone():Event
    {
        return new SelectPostEvent(post);
    }
}
}